<!DOCTYPE html>


<html lang="zh-CN">


<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    归档: 2022 |  Shimmer
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/myBlog/images/ayer.svg" />
  
  
<link rel="stylesheet" href="/myBlog/dist/main.css">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">
  
<link rel="stylesheet" href="/myBlog/css/custom.css">

  
  <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
  
  

  

<link rel="alternate" href="/myBlog/atom.xml" title="Shimmer" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    
      
      <canvas width="1777" height="841"
        style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
      
    <main class="content on">
      <section class="outer">
  
  
  <article class="articles">
    
    
    <h1 class="page-type-title">2022</h1>
    
    
  
  
  
  
  
  
  <div class="archives-wrap">
    <div class="archive-year-wrap">
      <a href="/myBlog/archives/2022" class="archive-year">2022</a>
    </div>
    <div class="archives">
      
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/11/19/2022-11-19-%E5%AF%B9react-toolkit%E8%B5%8B%E5%80%BC%E5%B0%81%E8%A3%85/" class="archive-article-date">
  <time datetime="2022-11-18T16:00:00.000Z" itemprop="datePublished">11/19</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/11/19/2022-11-19-%E5%AF%B9react-toolkit%E8%B5%8B%E5%80%BC%E5%B0%81%E8%A3%85/"
    >对react-toolkit赋值封装</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/10/26/2022-10-26-Rollup%E6%89%93%E5%8C%85%E5%BA%93%E6%96%87%E4%BB%B6/" class="archive-article-date">
  <time datetime="2022-10-25T16:00:00.000Z" itemprop="datePublished">10/26</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/10/26/2022-10-26-Rollup%E6%89%93%E5%8C%85%E5%BA%93%E6%96%87%E4%BB%B6/"
    >Rollup打包库文件</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/09/19/2022-09-19-%E5%AE%9E%E7%8E%B0%E2%80%9C%E7%BE%8A%E4%BA%86%E4%B8%AA%E7%BE%8A%E2%80%9D%E6%B6%88%E6%B6%88%E4%B9%90%EF%BC%88react%EF%BC%89/" class="archive-article-date">
  <time datetime="2022-09-18T16:00:00.000Z" itemprop="datePublished">09/19</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/09/19/2022-09-19-%E5%AE%9E%E7%8E%B0%E2%80%9C%E7%BE%8A%E4%BA%86%E4%B8%AA%E7%BE%8A%E2%80%9D%E6%B6%88%E6%B6%88%E4%B9%90%EF%BC%88react%EF%BC%89/"
    >实现“羊了个羊”消消乐（react）</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/09/09/2022-09-09-%E6%B5%8F%E8%A7%88%E5%99%A8%E7%9B%B8%E5%90%8C%E5%9C%B0%E5%9D%80%E4%B8%8D%E5%90%8C%E6%A0%87%E7%AD%BE%E9%A1%B5%E7%9A%84localStorage%E3%80%81sessionStorage%E3%80%81cookie/" class="archive-article-date">
  <time datetime="2022-09-08T16:00:00.000Z" itemprop="datePublished">09/09</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/09/09/2022-09-09-%E6%B5%8F%E8%A7%88%E5%99%A8%E7%9B%B8%E5%90%8C%E5%9C%B0%E5%9D%80%E4%B8%8D%E5%90%8C%E6%A0%87%E7%AD%BE%E9%A1%B5%E7%9A%84localStorage%E3%80%81sessionStorage%E3%80%81cookie/"
    >浏览器相同地址不同标签页的`localStorage、sessionStorage、cookie`</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/08/09/2022-08-09-react%E8%87%AA%E5%AE%9A%E4%B9%89hook,useWebSocket/" class="archive-article-date">
  <time datetime="2022-08-08T16:00:00.000Z" itemprop="datePublished">08/09</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/08/09/2022-08-09-react%E8%87%AA%E5%AE%9A%E4%B9%89hook,useWebSocket/"
    >react自定义hook,useWebSocket</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/05/19/2022-05-19-echarts%E5%AE%9E%E7%8E%B0%E9%A3%8E%E5%90%91%E7%8E%AB%E7%91%B0%E5%9B%BE/" class="archive-article-date">
  <time datetime="2022-05-18T16:00:00.000Z" itemprop="datePublished">05/19</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/05/19/2022-05-19-echarts%E5%AE%9E%E7%8E%B0%E9%A3%8E%E5%90%91%E7%8E%AB%E7%91%B0%E5%9B%BE/"
    >Echarts柱状极坐标风向玫瑰图的实现</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/05/09/2022-05-09-reduxjsToolkit%E4%BD%BF%E7%94%A8/" class="archive-article-date">
  <time datetime="2022-05-08T16:00:00.000Z" itemprop="datePublished">05/09</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/05/09/2022-05-09-reduxjsToolkit%E4%BD%BF%E7%94%A8/"
    >reduxjs/toolkit使用</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/04/28/2022-04-28-useState%E9%97%AE%E9%A2%98%E8%AE%B0%E5%BD%95/" class="archive-article-date">
  <time datetime="2022-04-27T16:00:00.000Z" itemprop="datePublished">04/28</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/04/28/2022-04-28-useState%E9%97%AE%E9%A2%98%E8%AE%B0%E5%BD%95/"
    >useState问题记录</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/04/02/2022-04-02-%E8%99%9A%E6%8B%9FDom/" class="archive-article-date">
  <time datetime="2022-04-01T16:00:00.000Z" itemprop="datePublished">04/02</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/04/02/2022-04-02-%E8%99%9A%E6%8B%9FDom/"
    >虚拟Dom</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
  
  
      <article class="archive-article archive-type-post">
  <div class="archive-article-inner">
    <header class="archive-article-header">
      <a href="/myBlog/2022/04/01/2022-04-01-Js%E5%86%85%E5%AD%98%E6%9C%BA%E5%88%B6%E3%80%81%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2/" class="archive-article-date">
  <time datetime="2022-03-31T16:00:00.000Z" itemprop="datePublished">04/01</time>
</a>
       
<h2 itemprop="name">
  <a class="archive-article-title" href="/myBlog/2022/04/01/2022-04-01-Js%E5%86%85%E5%AD%98%E6%9C%BA%E5%88%B6%E3%80%81%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2/"
    >js的内存机制、内存泄露</a> 
</h2>
 

    </header>
    
    
  </div>
</article>
      
      
    </div>
  </div>
  
  

  
  <nav class="page-nav">
    
    <span class="page-number current">1</span><a class="page-number" href="/myBlog/archives/2022/page/2/">2</a><a class="extend next" rel="next" href="/myBlog/archives/2022/page/2/">下一页</a>
  </nav>
  
</section>
      <!--
 * @Author: zhangzhen
 * @Date: 2023-02-04 10:30:09
 * @LastEditors: zhangzhen
 * @LastEditTime: 2023-05-23 09:47:12
 * 
-->
<footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2021-2023
        <i class="ri-heart-fill heart_icon"></i> Shimmer
      </li>
    </ul>
    <!-- <ul>
      <li>
        
        
        
        由 <a href="https://hexo.io" target="_blank">Hexo</a> 强力驱动
        <span class="division">|</span>
        主题 - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul> -->
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>访问人数:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>浏览次数:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/myBlog/"><img src="/myBlog/images/ayer-side.svg" alt="Shimmer"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/myBlog/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/myBlog/archives">目录</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/myBlog/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/myBlog/photos">相册</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/myBlog/2021/02/12/2021-02-12-%E5%85%B3%E4%BA%8E%E6%88%91/">关于我</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/myBlog/message">留言板</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    
  </div>
</div>
    
<script src="/myBlog/js/jquery-2.0.3.min.js"></script>


<script src="/myBlog/js/lazyload.min.js"></script>

<!-- Tocbot -->

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/myBlog/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->


<script src="/myBlog/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->


<script src="/myBlog/js/clickBoom2.js"></script>


<!-- CodeCopy -->


<link rel="stylesheet" href="/myBlog/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>


<!-- CanvasBackground -->


    
  </div>
</body>

</html>